<!DOCTYPE HTML>
<html>
<head>
	<script type="text/javascript">
        function clickCunter(){
        	if(typeof(Storage)!=="undefined"){
        		if(sessionStorage.clickcount){
        			sessionStorage.clickcount = Number(sessionStorage.clickcount)+1;
        		}else{
        			sessionStorage.clickcount = 1;
        		}
        		
        		document.getElementById('result').innerHTML = "在本 session 中，您已经点击这个按钮："+ sessionStorage.clickcount + "次。"; 
        	}else{
        		document.getElementById("result").innerHTML = "抱歉，您的浏览器不支持 Web Store....";
        	}
        }
	</script>

</head>
	<body>
		

		<p><button type="button" onclick="clickCunter()">请点击这里</button></p>
		<div id="result"></div>
		<p>请点击使计数器递增。</p>
		<p>请关闭浏览器或标企页，再试一次，计数器会重置。</p>
	</body>
</html>